package com.wangxin.study8.completablefuture;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/**
 * @ClassName Before
 * @Description java8之前异步调用
 * @Author Wangxin
 * @Date 2019-03-24 18:14
 * @Version 1.0
 **/
public class Before {
    public static void main(String[] args) throws Exception{
        ExecutorService service = Executors.newFixedThreadPool(1);
        Future<Integer> future = service.submit(()->{
            try {
                Thread.sleep(100);
            }catch (Exception e){
                e.printStackTrace();
            }
            return 1;
        });
        System.out.println(future.get());
        System.out.println("end!!");
    }
}
